#!/usr/bin/env node

//类
const Koa = require('koa');

const app = new Koa();

app.use((ctx,next)=>{ //M-logger
  console.log(`${ctx.method} ${ctx.path}`);
  next();
  
});

app.use((ctx,next)=>{ //M-hello中间件
  ctx.body = 'hello world!';  
});

app.listen(8080);

console.log('hello koa2');
